﻿@model ThaireInvestmentWeb.Models.EditLoanHeaderModel
@{
    ViewBag.Title = "EditLoanHeader";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script>
    $(document).ready(function () {

        $("#Header_MortgageDate,#Header_ProtectionEndDate,#Header_ProtectionStartDate,#Header_AssessmentDate,#ContractEndDate,#ContractStartDate,#Header_MortgageDate").datepicker(
            {
                dateFormat: 'dd/mm/yy',
                yearRange: "-30:+40",
                isBuddhist: true,
                showOn: 'button',
                showAnim: 'fadeIn',
                changeMonth: true,
                changeYear: true,
                showButtonPanel: true,
                buttonImage: '@Url.Content("~/Content/images/Calendar.png")',
                onSelect: function (dateText, inst) {
                    if (this.id == "Header_ContractEndDate") {
                        //    alert(dateText);
                        getMaturityStatus(dateText);
                    }
                }
            }
        );
        $("#CancelBtn").click(function (event) {
            //showConfirm("Are you sure to cancel ?", CancelBtnAction);
            showConfirm(null, CancelBtnAction);
            return false;
        });
        $("#Province").autocomplete({
            source: function(request,response) {
                $.ajax({
                    url: "@(Url.Action("GetProvinceAutocomplete", "Loan"))"+ "?param=" + $("#SelectedProvince").val(),
                    type: "POST",
                    dataType: "json",
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item, value: item };
                        }))
                    }
                })
            }
        });
        $("#District").autocomplete({
            source: function(request,response) {
                $.ajax({
                    url: "@(Url.Action("GetDistrictAutocomplete", "Loan"))"+ "?param=" + $("#SelectedDistrict").val(),
                    type: "POST",
                    dataType: "json",
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item, value: item };
                        }))
                    }
                })
            }
        });       
        $("#SubDistrict").autocomplete({
            source: function(request,response) {
                $.ajax({
                    url: "@(Url.Action("GetSubDistrictAutocomplete", "Loan"))"+ "?param=" + $("#SelectedSubDistrict").val(),
                    type: "POST",
                    dataType: "json",
                    success: function (data) {
                        response($.map(data, function (item) {
                            return { label: item, value: item };
                        }))
                    }
                })
            }
        });
        $("#Header_AssessmentCost").change(FormatNumber2Digits);
        $("#Header_AssetValue").change(FormatNumber2Digits);
        $("#ContractAmount").change(FormatNumber2Digits);

    });
    function CancelBtnAction(event) {
        window.location.href = 'ManageUnitTrust';
    }
    function getMaturityStatus(value) {
        $.ajax({
            url: "@Url.Action("GetMaturityStatus", "Loan")" + "?contractEndDate=" + value,
                type: 'POST',
                success: function (data) {
                    $('#Header_MaturityStatus').val(data.MaturityStatus);
                    return false;
                }
            });
        }
        function getInvolvedType(id) {
            $.ajax({
                url: "@Url.Action("GetInvolvedType", "Loan")" + "?id=" + id,
                type: 'POST',
                success: function (data) {
                    $('#InvolvedPartyTypeNo').val(data.InvolvedPartyTypeCode);
                    return false;
                }
            });
        }


</script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


<table class="navi" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td style="width: 100%;">
            <div class="navi">
                Instrument Type > <a href="@Url.Action("ManageLoan", "Loan", new { headerId = @Model.HeaderID })">Loans</a> > Loans Header
          
            </div>
        </td>
    </tr>
</table>

<table class="tableheader" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td height="38" align="center" style="width: 100%; text-align: center;">INPUT Loans</td>
    </tr>
</table>

<table width="1024" border="0" align="center">
    <tr>
        <td>
            @using (Html.BeginForm("EditLoanHeader", "Loan", FormMethod.Post, new { id = "mainForm" }))
            {
                @Html.ValidationSummary(true)

                <table width="100%" border="0" align="center" cellspacing="2">
                    <tr>
                        <td width="300" height="31">&nbsp;</td>
                        <td align="right">
                            <div style="text-align: right">Create by : @Model.Header.CreateBY </div>
                        </td>
                        <td width="5">&nbsp;</td>
                        <td width="139" align="right">
                            <div style="text-align: right">Create Time :@Model.Header.CreateDate</div>
                        </td>
                    </tr>
                    <tr>
                        <td width="300" height="31">&nbsp;</td>
                        <td align="right">
                            <div style="text-align: right">Update by : @Model.Header.ModifyBY</div>
                        </td>
                        <td width="5">&nbsp;</td>
                        <td width="139" align="right">
                            <div style="text-align: right">Update Time :@Model.Header.ModifyDate</div>
                        </td>
                    </tr>
                </table>
 
                <table class="tableform" width="100%" align="center" cellspacing="2px">
                    <tr>
                        <td style="width: 15%">
                            <div align="right">
                                Company <span class="error">* </span>:
                            </div>
                        </td>
                        <td style="width: 30%">
                            @Html.DropDownListFor(x => x.SelectedCompany, Model.CompanyList)
                            @Html.ValidationMessageFor(model => model.SelectedCompany)
                        </td>
                        <td style="width: 19%; text-align: right">
                            <div align="right">Maturity Status:</div>
                        </td>
                        <td style="width: 26%">
                            <table width="71%" border="0" cellspacing="1" bgcolor="#000000">
                                <tr>
                                    <td bgcolor="#FFFFFF">
                                        @Html.TextBoxFor(model => model.Header.MaturityStatus, new { @readonly = "readonly" })
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">Loan Type <span class="error">*</span> : </div>
                        </td>
                        <td>
                            @Html.DropDownListFor(x => x.SelectedLoanType, Model.LoanTypeList)</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <div style="text-align: right; width: 150px">
                                Contract Number <span class="error">*</span>:
                            </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.ContractNumber)
                            @Html.ValidationMessageFor(model => model.ContractNumber)</td>
                        <td>
                            <div align="right">วัตถุประสงค์: </div>
                        </td>
                        <td>
                            @Html.DropDownListFor(x => x.SelectedObjective, Model.ObjectiveList)
                            @Html.ValidationMessageFor(model => model.SelectedObjective)

                        </td>
                    </tr>
                    <tr>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF" colspan="2"><strong>รายละเอียดผู้กู้</strong></td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">
                                ชื่อ <span class="error">* </span>
                                :
                            </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.BorrowerName)
                            @Html.ValidationMessageFor(model => model.BorrowerName)
                        </td>
                        <td style="background-color: #E8ECFF">
                            <div align="right">อาชีพ: </div>
                        </td>
                        <td style="background-color: #E8ECFF">
                            @Html.DropDownListFor(x => x.SelectedOccupationsOfBorrower, Model.OccupationsOfBorrowerList)
                            @Html.ValidationMessageFor(model => model.SelectedOccupationsOfBorrower)
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">เลขที่บัตรประชาชน: </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.BorrowerIDCardNO)
                            @Html.ValidationMessageFor(model => model.Header.BorrowerIDCardNO)
                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF" colspan="2"><strong>รายละเอียดผู้ค้ำประกัน</strong></td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">ชื่อ: </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.GuarantorName)
                            @Html.ValidationMessageFor(model => model.Header.GuarantorName)
                        </td>
                        <td style="background-color: #E8ECFF">
                            <div align="right">อาชีพ: </div>
                        </td>
                        <td style="background-color: #E8ECFF">
                            @Html.DropDownListFor(x => x.SelectedOccupationsOfGuarantor, Model.OccupationsOfGuarantorList)
                            @Html.ValidationMessageFor(model => model.SelectedOccupationsOfGuarantor)
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">เลขที่บัตรประชาชน: </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.GuarantorIDCardNO)
                            @Html.ValidationMessageFor(model => model.Header.GuarantorIDCardNO)
                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">
                                ประเภทหลักประกัน<span class="error">*</span> :
                            </div>
                        </td>
                        <td>
                            @Html.DropDownListFor(x => x.SelectedGuaranteeType, Model.GuaranteeTypeList)
                            @Html.ValidationMessageFor(model => model.SelectedGuaranteeType)
                        </td>
                        <td style="text-align: right">ผู้ถือครองกรรมสิทธิ์ :</td>
                        <td>
                            <select name="select20" id="select20">
                                <option>--Select data--</option>
                                @*<option value="1">Thaire Life</option>
                                <option value="2">Thaire Training</option>
                                <option value="3">Thaire Service</option>*@
                            </select>

                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">ชื่อผู้จำนอง (1)  : </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Header.MortgagorName1)
                            @Html.ValidationMessageFor(model => model.Header.MortgagorName1)

                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">ชื่อผู้จำนอง (2)  : </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Header.MortgagorName2)
                            @Html.ValidationMessageFor(model => model.Header.MortgagorName2)
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">ชื่อผู้จำนอง (3)  : </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Header.MortgagorName3)
                            @Html.ValidationMessageFor(model => model.Header.MortgagorName3)
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">รายละเอียดทรัพย์สินที่ทำจำนอง   : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.DropDownListFor(x => x.SelectedAssessmentMortgate, Model.AssessmentMortgateList)
                            @Html.ValidationMessageFor(model => model.SelectedAssessmentMortgate)

                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right"><strong>ตำแหน่งที่ดิน</strong>&nbsp; </div>
                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">ระวาง   : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.TitleDeedMapsheetNO)
                            @Html.ValidationMessageFor(model => model.Header.TitleDeedMapsheetNO)

                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">เลขที่ดิน   : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.TitleDeedParcelNO)
                            @Html.ValidationMessageFor(model => model.Header.TitleDeedParcelNO)
                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">หน้าสำรวจ   : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.TitleDeedDealingFileNO)
                            @Html.ValidationMessageFor(model => model.Header.TitleDeedDealingFileNO)
                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right"><strong>โฉนดที่ดิน </strong></div>
                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF; text-align: right;"><strong>ที่ตั้งห้องชุด</strong></td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">เลขที่   : </div>
                        </td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextBoxFor(model => model.Header.TitleDeedNO, new { style = "width:280px", maxlength = 120 })
                            @Html.ValidationMessageFor(model => model.Header.TitleDeedNO)
                        </td>
                        <td style="background-color: #E8ECFF; text-align: right;">ห้องชุดเลขที่   : </td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextBoxFor(model => model.Header.ApartmentNO)
                            @Html.ValidationMessageFor(model => model.Header.ApartmentNO)
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">เล่ม   : </div>
                        </td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextBoxFor(model => model.Header.TitleDeedVolumn, new { style = "width:120px", maxlength = 100 })
                            @Html.ValidationMessageFor(model => model.Header.TitleDeedVolumn)

                            หน้า
                            @Html.TextBoxFor(model => model.Header.TitleDeedPage, new { style = "width:120px", maxlength = 100 })
                            @Html.ValidationMessageFor(model => model.Header.TitleDeedPage)
                        </td>
                        <td style="background-color: #E8ECFF; text-align: right;">ชั้นที่ : </td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextBoxFor(model => model.Header.ApartmentFloor)
                            @Html.ValidationMessageFor(model => model.Header.ApartmentFloor)
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">จังหวัด   : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.DropDownListFor(x => x.SelectedProvince, Model.ProvinceList)
                           @* @Html.TextBoxFor(model => model.SelectedProvince)*@
                            @Html.ValidationMessageFor(model => model.SelectedProvince)

                        </td>
                        <td style="background-color: #E8ECFF; text-align: right;">อาคารเลขที่ : </td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextBoxFor(model => model.Header.ApartmentBuildingNO)
                            @Html.ValidationMessageFor(model => model.Header.ApartmentBuildingNO)
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">อำเภอ   : </div>
                        </td>
                        <td style="background-color: #E8ECFF">
                            @Html.DropDownListFor(x => x.SelectedDistrict, Model.DistrictList)
                            @*@Html.TextBoxFor(model => model.SelectedDistrict)*@
                            @Html.ValidationMessageFor(model => model.SelectedDistrict)
                        </td>
                        <td style="background-color: #E8ECFF; text-align: right;">ชื่ออาคารชุด :</td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextAreaFor(model => model.Header.ApartmentBuildingName, new { style = "height: 50px; width: 250px;", maxlength = 120 })
                            @Html.ValidationMessageFor(model => model.Header.ApartmentBuildingName)
                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">ตำบล   : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.DropDownListFor(x => x.SelectedSubDistrict, Model.SubDistrictList)
                            @*@Html.TextBoxFor(model => model.SelectedSubDistrict)*@
                            @Html.ValidationMessageFor(model => model.SelectedSubDistrict)
                        </td>
                        <td style="background-color: #E8ECFF; text-align: right;">ทะเบียนอาคารชุดเลขที่ : </td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextBoxFor(model => model.Header.RegisterBuildingNO)
                            @Html.ValidationMessageFor(model => model.Header.RegisterBuildingNO)</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">เนื้อที่ (ไร่-งาน-ตร.วา)   : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.TitleDeedTotalArea)
                            @Html.ValidationMessageFor(model => model.Header.TitleDeedTotalArea)
                        </td>
                        <td style="background-color: #E8ECFF"> <div align="right">เนื้อที่ประมาณ (ตร.เมตร) :</div></td>
                        <td style="background-color: #E8ECFF">@*@Html.TextBoxFor(model => model.Header.TitleDeedTotalArea)*@</td>
                    </tr>
                    <tr>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">วันที่จำนอง  : </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Header.MortgageDate, new { style = "width: 80px;", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.Header.MortgageDate) })
                            @Html.ValidationMessageFor(model => model.Header.MortgageDate) 
                            (Ex.31/12/2014)</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">ระยะเวลาเริ่มต้น<span class="error">* </span>: </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.ContractStartDate, new { style = "width: 80px;",  @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.ContractStartDate) })
                            @Html.ValidationMessageFor(model => model.ContractStartDate)  
                            (Ex.31/12/2014)</td>
                        <td>
                            <div align="right">ระยะเวลาสิ้นสุด<span class="error">* </span>: </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.ContractEndDate, new { style = "width: 80px;",  @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.ContractEndDate) })
                            @Html.ValidationMessageFor(model => model.ContractEndDate) 
                            (Ex.31/12/2014)</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">วันที่ประเมินราคาทรัพย์สินที่จำนอง : </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Header.AssessmentDate, new {  style = "width: 80px;", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.Header.AssessmentDate) })
                            @Html.ValidationMessageFor(model => model.Header.AssessmentDate) (Ex.31/12/2014)</td>
                        <td>
                            <div align="right">ราคาประเมิน : </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Header.AssessmentCost, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency2(@Model.Header.AssessmentCost) })
                            @Html.ValidationMessageFor(model => model.Header.AssessmentCost)</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">มูลค่าทรัพย์สิน/วงเงินค้ำประกัน   : </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Header.AssetValue, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency2(@Model.Header.AssetValue) })
                            @Html.ValidationMessageFor(model => model.Header.AssetValue)
                        </td>
                        <td style="text-align: right">@*ผู้ประเมิน :*@ </td>
                        <td>
                            @*@Html.TextBoxFor(model => model.Header.AssetValue)
@Html.ValidationMessageFor(model => model.Header.AssetValue)*@</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">จำนวนเงินตามสัญญา<span class="error">* </span>: </div>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.ContractAmount, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency2(@Model.ContractAmount) })
                            @Html.ValidationMessageFor(model => model.ContractAmount)
                            &nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">Liquidity : </div>
                        </td>
                        <td colspan="3">
                            @Html.CheckBoxFor(model => model.IsTierISelected)

                            Tier I&nbsp; 

                            @Html.TextBoxFor(model => model.Header.LiquidityTierIPercent)
                            @Html.ValidationMessageFor(model => model.Header.LiquidityTierIPercent)
                            %
                            <br />
                            @Html.CheckBoxFor(model => model.IsTierIISelected)

                            Tier II&nbsp;

                            @Html.TextBoxFor(model => model.Header.LiquidityTierIIPercent)
                            @Html.ValidationMessageFor(model => model.Header.LiquidityTierIIPercent)

                            %
                            <br />
                            @Html.CheckBoxFor(model => model.IsLowLiquiditySelected)
                            Low Liquidity&nbsp;
                            @Html.TextBoxFor(model => model.Header.LiquidityLowLiquidityPercent)
                            @Html.ValidationMessageFor(model => model.Header.LiquidityLowLiquidityPercent)
                            %
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">Involved Party Type:</div>
                        </td>
                        <td colspan="3">
                            <table>
                                <tr>
                                    <td>@Html.DropDownListFor(x => x.SelectedInvolvedPartyType, Model.InvolvedPartyTypeNameList, new { onchange = "getInvolvedType(this.value)" }) </td>
                                    <td align="right">Involved Party Type No.:</td>
                                    <td>@Html.TextBoxFor(model => model.InvolvedPartyTypeNo, new { @readonly = "readonly", style = " width: 100px;" })</td>
                                </tr>
                            </table>

                        </td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">หมายเลข กธ.    : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.InsuranceNO)
                            @Html.ValidationMessageFor(model => model.Header.InsuranceNO)

                        </td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                        <td style="background-color: #E8ECFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="background-color: #E8ECFF">
                            <div align="right">วันเริ่มคุ้มครอง    : </div>
                        </td>
                        <td style="background-color: #E8ECFF;">
                            @Html.TextBoxFor(model => model.Header.ProtectionStartDate, new {style = "width: 80px;", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.Header.ProtectionStartDate) })
                            @Html.ValidationMessageFor(model => model.Header.ProtectionStartDate) (Ex.31/12/2014)
                        </td>
                        <td style="background-color: #E8ECFF">
                            <div align="right">วันสิ้นสุดความคุ้มครอง    : </div>
                        </td>
                        <td style="background-color: #E8ECFF">
                            @Html.TextBoxFor(model => model.Header.ProtectionEndDate, new {style = "width: 80px;", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.Header.ProtectionEndDate) })
                            @Html.ValidationMessageFor(model => model.Header.ProtectionEndDate) (Ex.31/12/2014)</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right"></div>
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                </table>

                <table width="95%" border="0" align="center" style="height: 38px">

                    <tr>
                        <td style="height: 38px">
                            <div align="center">
                                <input id="SaveBtn" type="submit" name="SaveBtn" value=" Submit " class="button" need-confirm="true">
                                &nbsp;&nbsp; 
                                <input id="CancelBtn" type="button" name="CancelBtn" value=" Cancel " class="button">
                            </div>
                        </td>
                    </tr>

                </table>
                
                if (Model.UpdateMode)
                {
                <table width="95%" border="0">
                    <tr>
                        <td>
                            <div style="text-align: right">
                                <input type="button" name="PurchaseBtn" value=" interest " class="button" onClick="go('@Url.Action("LoanInterest", "Loan", new { headerID = Model.Header.LoansHeaderID.ToString() })    ');" >
                                &nbsp;&nbsp; 
                                <input type="button" name="Submit42" class="btsub" value="  Extra Installment  " onClick="go('@Url.Action("EditLoanExtraIntallment", "Loan", new { headerId = Model.Header.LoansHeaderID.ToString() })    ');" >
                            </div>
                        </td>
                    </tr>
                </table>

                }
                @Html.HiddenFor(x => x.UpdateMode)
                @Html.HiddenFor(x => x.HeaderID)
            }
            <br>
        </td>
    </tr>
</table>
